// pages/a2/a2.js
Page({
  t: 0,
  data: {
    total: 3,
    navId: 1,
    buttonText: '显示答案',
    userSelect: '',
    navs: [
      {
        id:1 ,
       label: '第一题',
       question: '若要求减小放大电路向信号源索取的电流，应该引入_________；若要求在负载变化时输出电流稳定，应该引入_________；若要求在负载变化时输出电压稳定，应该引入_________。',
       question_img: '',
        answer: 'C、B、A ',
        answer_img: '',
        options: [
        {code: 'A',
        option: '电压负反馈;'
        },
        {code: 'B',
         option: '电流负反馈;'
       },
        {code: 'C',
        option: '串联负反馈;'
        },
       {code: 'D',
       option: '并联负反馈;'
        }
       ]
       },
       {
        id:2 ,
       label: '第二题',
       question: '在_________中，空穴浓度大于电子浓度；在_________中，空穴浓度等于电子浓度。',
       question_img: '',
        answer: 'B，A',
        answer_img: '',
        options: [
        {code: 'A',
        option: '本征半导体;'
        },
        {code: 'B',
         option: 'P型半导体;'
       },
        {code: 'C',
        option: 'N型半导体;'
        },
       ]
       },
       {
        id: 3,
       label: '第三题',
       question: '在共射、共基、共集三种基本放大电路组态中，希望电压放大倍数绝对值大，可选用_________；希望高频响应性能好，应选用_________。',
       question_img: '',
        answer: '',
        answer_img: '',
        options: [
        {code: 'A',
        option: '共射组态;'
        },
        {code: 'B',
         option: '共集组态;'
       },
        {code: 'C',
        option: '共基组态;'
        },
       {code: 'D',
       option: ';'
        }
       ]
       },
       {
        id: 4,
       label: '第四题',
       question: '',
       question_img: '',
        answer: '',
        answer_img: '',
       },
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },
  itemTap (ev) {
    const id = ev.target.dataset.id
    this.setData({
      //navId: 'n'+id,
      userSelect: '',
      navId: id
      //toView: 'n' + (id-1)
    })
  },
  submit(ev){
    let ac = this.data.appear
    //let ab = ev.target.dataset.navs.a
    this.setData({
      appear: !ac,
      buttonText: ac?'显示答案':'收回答案'
    })
  },
  radioChange(e){
    let a = e.detail.value
    this.setData({
      userSelect: a
    })
  }
})